# -*- coding: utf-8

def jfpal():
    rfile = open('data/jfpal.txt','r')
    wfile1 = open('data/Q.txt','w+')
    wfile2 = open('data/A.txt','w+')
    flag = 0
    while(1):
        line = rfile.readline()
        if not line:
            break
        line = line.strip()
        if line.find("？") != -1:
            flag = 1
            wfile1.write(line[line.find('、'):].replace('、','')+"\n")
        if line.find("？") == -1 and flag == 0:
            wfile2.write(line)
        if line.find("？") == -1 and flag == 1:
            wfile2.write(line+'\n')
            flag = 0
    rfile.close()
    wfile1.close()
    wfile2.close()

if __name__ == "__main__":
    jfpal()
    print "eun"